import cv2
import math
import numpy as np
from argparse import ArgumentParser

import skimage


def main(option):
    original_img = cv2.imread(option.original_file, cv2.IMREAD_GRAYSCALE)
    compare_img = cv2.imread(option.compare_file, cv2.IMREAD_GRAYSCALE)
    psnr_score = skimage.measure.compare_psnr(original_img, compare_img)
    ssim_score = skimage.measure.compare_ssim(original_img, compare_img)
    print('PSNR: ' + str(psnr_score))
    print('SSIM: ' + str(ssim_score))


if __name__ == '__main__':
    parser = ArgumentParser()
    parser.add_argument('--original_file', type=str, default='lena_gray.bmp')
    parser.add_argument('--compare_file', type=str, default='output/noise/gaussian_mu=0.00_sigma=10.00.bmp')
    option = parser.parse_args()
    main(option)
